package com.atguigu.gulimail.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 开启定时任务
 * 开启异步任务
 */
@Slf4j
@Component
//@EnableScheduling
//@EnableAsync
public class HelloSchedule {
//    @Async
//    @Scheduled(cron = "* * * ? * 6")
    public void Hello() throws InterruptedException {
      log.info("hello...");
      Thread.sleep(3000);
    }
}
